import request from '@/utils/request'

/**
 * 获取隐患跟踪处置列表
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function getSurveyTaskList(params) {
  return request({
    url: '/safe//SurveyTaskTrackingList',
    method: 'get',
    params
  })
}

/**
 * 新增隐患跟踪处置
 * @param {Object} data - 任务数据
 * @returns {Promise}
 */
export function addSurveyTask(data) {
  return request({
    url: '/safe/addSurveyTaskTracking',
    method: 'post',
    data
  })
}

/**
 * 修改隐患跟踪处置
 * @param {Object} data - 任务数据
 * @returns {Promise}
 */
export function updateSurveyTask(data) {
  return request({
    url: '/safe/updateTaskTracking',
    method: 'post',
    data
  })
}

/**
 * 获取隐患跟踪处置详情
 * @param {string} id - 任务ID
 * @returns {Promise}
 */
export function getSurveyTaskDetail(id) {
  return request({
    url: `/safe/SurveyTaskTrackingDetail/${id}`,
    method: 'get'
  })
}

/**
 * 删除隐患跟踪处置
 * @param {string} id - 任务ID
 * @returns {Promise}
 */
export function deleteSurveyTask(id) {
  return request({
    url: `/safe/deleteTaskTracking/${id}`,
    method: 'post'
  })
}